/*
 * @Author: windys
 * @Description: 
 * @Date: 2022-02-11 15:32:26
 */
import { createApp } from 'vue'
import App from './App.vue'
import 'amfe-flexible'
import router from "./router";
// ui
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// css
import './style/rest.css'
import './style/global.scss'
import './style/variable.scss'
import components from './components/index.js'
import store from './store'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 国际化
import i18n from "@/i18n/index";
// iocns
import 'virtual:svg-icons-register'
// 指令
import directive from '@/directives/index'
//校验
import { vue_best_verify } from "vue-best-verify";
import "vue-best-verify/dist/style.css";
// 唯一标识
import { guid } from './utils';
import storage from "@/utils/storage";
// loding
import loading from './plugin/loading';
// 分享
const app = createApp(App)
// // 谷歌
// import vue3GoogleLogin from 'vue3-google-login'
// console.log(vue3GoogleLogin, '---------')
// app.use(vue3GoogleLogin, {
//   clientId: '30152747685-irtuqrucjgvu37ef4ae5ff5m635luhbq.apps.googleusercontent.com'
// })
// 分享
import VueSocialSharing from 'vue-social-sharing'



directive(app)
app.use(vue_best_verify)
app.use(store)
app.use(i18n)
app.use(ElementPlus)
app.use(VueSocialSharing)
app.use(loading)



app.use(components)
// 主题设置
store.dispatch('setTheme')
store.dispatch('getCarNums')


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}


if (!storage.getStorage('uuid')) {
  storage.setStorage('uuid', guid)
}


if (!storage.getStorage('LANG')) {
  window.localStorage.setItem('LANG', 'zh');

}

router.beforeEach((to, from, next) => {
  window.scrollTo(0, 0)
  document.title = to.meta.title
  next()
})

app.use(router).mount('#app')


